From 081db0ddef0367bedd3fa1baa2202c2ceeca6a61 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Fri, 18 Nov 2005 11:04:58 -0600 Subject: [PATCH] Fix read of guest psr to properly set dfh and other bits (by Matt Chapman) --- xen/arch/ia64/xen/vcpu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/xen/arch/ia64/xen/vcpu.c b/xen/arch/ia64/xen/vcpu.c index 33969d0774..4aa50eea40 100644 --- a/xen/arch/ia64/xen/vcpu.c +++ b/xen/arch/ia64/xen/vcpu.c @@ -345,19 +345,17 @@ IA64FAULT vcpu_set_psr_l(VCPU *vcpu, UINT64 val) IA64FAULT vcpu_get_psr(VCPU *vcpu, UINT64 *pval) { - UINT64 psr; + REGS *regs = vcpu_regs(vcpu); struct ia64_psr newpsr; - // TODO: This needs to return a "filtered" view of - // the psr, not the actual psr. Probably the psr needs - // to be a field in regs (in addition to ipsr). - __asm__ __volatile ("mov %0=psr;;" : "=r"(psr) :: "memory"); - newpsr = *(struct ia64_psr *)&psr; + newpsr = *(struct ia64_psr *)®s->cr_ipsr; if (newpsr.cpl == 2) newpsr.cpl = 0; if (PSCB(vcpu,interrupt_delivery_enabled)) newpsr.i = 1; else newpsr.i = 0; if (PSCB(vcpu,interrupt_collection_enabled)) newpsr.ic = 1; else newpsr.ic = 0; + if (PSCB(vcpu,metaphysical_mode)) newpsr.dt = 0; + else newpsr.dt = 1; // FIXME: need new field in mapped_regs_t for virtual psr.pp (psr.be too?) if (PSCB(vcpu,tmp[8])) newpsr.pp = 1; else newpsr.pp = 0; -- 2.30.2